iommu: adjust section annotations in pass-through code
authorKeir Fraser <keir@xen.org>
Fri, 19 Nov 2010 13:23:34 +0000 (13:23 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 19 Nov 2010 13:23:34 +0000 (13:23 +0000)
Most importantly, anything Dom0 construction related can be __init.

Signed-off-by: Jan Beulich <jbeulich@novell.com>
xen/drivers/passthrough/amd/pci_amd_iommu.c
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/vtd/ia64/vtd.c
xen/drivers/passthrough/vtd/iommu.c
xen/drivers/passthrough/vtd/x86/ats.c
xen/drivers/passthrough/vtd/x86/vtd.c

index dd5bc774b1524d8493173bb28a1b388a46201abe..2140c17eccc6d9e4d26e0573655c466bad63dd42 100644 (file)
@@ -117,7 +117,7 @@ static void amd_iommu_setup_domain_device(
     spin_unlock_irqrestore(&iommu->lock, flags);
 }
 
-static void amd_iommu_setup_dom0_devices(struct domain *d)
+static void __init amd_iommu_setup_dom0_devices(struct domain *d)
 {
     struct amd_iommu *iommu;
     struct pci_dev *pdev;
@@ -232,7 +232,7 @@ static int amd_iommu_domain_init(struct domain *d)
     return 0;
 }
 
-static void amd_iommu_dom0_init(struct domain *d)
+static void __init amd_iommu_dom0_init(struct domain *d)
 {
     unsigned long i; 
 
index c9c1835005135e256bb3674da8045c6de5817dad..57f0daa3761a32fcd9f165df08e3cfa4d4375f41 100644 (file)
@@ -40,7 +40,7 @@ static int iommu_populate_page_table(struct domain *d);
 custom_param("iommu", parse_iommu_param);
 bool_t __read_mostly iommu_enabled = 1;
 bool_t __read_mostly force_iommu;
-bool_t __read_mostly iommu_dom0_strict;
+bool_t __initdata iommu_dom0_strict;
 bool_t __read_mostly iommu_verbose;
 bool_t __read_mostly iommu_workaround_bios_bug;
 bool_t __read_mostly iommu_passthrough;
@@ -102,7 +102,7 @@ int iommu_domain_init(struct domain *d)
     return hd->platform_ops->init(d);
 }
 
-void iommu_dom0_init(struct domain *d)
+void __init iommu_dom0_init(struct domain *d)
 {
     struct hvm_iommu *hd = domain_hvm_iommu(d);
 
index 5ff7623739d961d59c7cf8fbf30c6d1b6d362e09..6f64f5767625fd0ad49e5cbca5857c8d721012ef 100644 (file)
@@ -92,8 +92,8 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
     /* dummy */
 }
 
-static int do_dom0_iommu_mapping(unsigned long start, unsigned long end,
-                               void *arg)
+static int __init do_dom0_iommu_mapping(unsigned long start,
+                                       unsigned long end, void *arg)
 {
     unsigned long tmp, pfn, j, page_addr = start;
     struct domain *d = (struct domain *)arg;
@@ -120,7 +120,7 @@ static int do_dom0_iommu_mapping(unsigned long start, unsigned long end,
     return 0;
 }
 
-void iommu_set_dom0_mapping(struct domain *d)
+void __init iommu_set_dom0_mapping(struct domain *d)
 {
        if (dom0)
            BUG_ON(d != dom0);
index 4d66a3fcf6625d45ec1853ef0a0d14be20902433..47b6f6807552b0f93ff75940e78dca96bb954a48 100644 (file)
@@ -1231,7 +1231,7 @@ static int intel_iommu_domain_init(struct domain *d)
     return 0;
 }
 
-static void intel_iommu_dom0_init(struct domain *d)
+static void __init intel_iommu_dom0_init(struct domain *d)
 {
     struct acpi_drhd_unit *drhd;
 
@@ -1826,7 +1826,7 @@ static int intel_iommu_remove_device(struct pci_dev *pdev)
     return domain_context_unmap(pdev->domain, pdev->bus, pdev->devfn);
 }
 
-static void setup_dom0_devices(struct domain *d)
+static void __init setup_dom0_devices(struct domain *d)
 {
     struct pci_dev *pdev;
     int bus, devfn;
@@ -1961,7 +1961,7 @@ static int init_vtd_hw(void)
     return 0;
 }
 
-static void setup_dom0_rmrr(struct domain *d)
+static void __init setup_dom0_rmrr(struct domain *d)
 {
     struct acpi_rmrr_unit *rmrr;
     u16 bdf;
index e56c9d5ad450a95681d2bab2b719d1fd4ee9ee79..cf564444cd6e65260fb8539c3f74cb8d0d606010 100644 (file)
@@ -28,7 +28,7 @@
 #include "../vtd.h"
 #include "../extern.h"
 
-LIST_HEAD(ats_dev_drhd_units);
+static LIST_HEAD(ats_dev_drhd_units);
 
 #define ATS_REG_CAP    4
 #define ATS_REG_CTL    6
@@ -47,9 +47,9 @@ static LIST_HEAD(ats_devices);
 static void parse_ats_param(char *s);
 custom_param("ats", parse_ats_param);
 
-int ats_enabled = 1;
+int __read_mostly ats_enabled = 1;
 
-static void parse_ats_param(char *s)
+static void __init parse_ats_param(char *s)
 {
     char *ss;
 
index 72323c9002fd642b69b3696cec36a41e1cf3dc58..c561924f84c361968e73a105a7c9e3ee817819b5 100644 (file)
@@ -34,7 +34,7 @@
  * iommu_inclusive_mapping: when set, all memory below 4GB is included in dom0
  * 1:1 iommu mappings except xen and unusable regions.
  */
-static int iommu_inclusive_mapping = 1;
+static int __read_mostly iommu_inclusive_mapping = 1;
 boolean_param("iommu_inclusive_mapping", iommu_inclusive_mapping);
 
 void *map_vtd_domain_page(u64 maddr)
@@ -127,7 +127,7 @@ void hvm_dpci_isairq_eoi(struct domain *d, unsigned int isairq)
     spin_unlock(&d->event_lock);
 }
 
-void iommu_set_dom0_mapping(struct domain *d)
+void __init iommu_set_dom0_mapping(struct domain *d)
 {
     u64 i, j, tmp, max_pfn;
     extern int xen_in_range(unsigned long mfn);